package com.kucai.yifaqapp.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.kucai.yifaqapp.R;
import com.kucai.yifaqapp.global.Info;

public class IdearActivity extends BaseActivitySimple {
    TextView onlinserver;
    TextView insertidear;
    TextView shensu;
    Button headerButton;
    private TextView title_left_tv;
    private LinearLayout skinbg;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_idear);
//        ButterKnife.bind(this);
        onlinserver = findViewById(R.id.onlinserver);
        insertidear = findViewById(R.id.insertidear);
        shensu = findViewById(R.id.shensu);
        headerButton = findViewById(R.id.headerButton);
        title_left_tv = findViewById(R.id.title_left_tv);
        skinbg = findViewById(R.id.skinbg);
        title_left_tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        onlinserver.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (Info.seviceurl != null) {
                    Intent intent = new Intent(IdearActivity.this, WebActivity.class);
                    Bundle bundle = new Bundle();
                    bundle.putString("url", Info.seviceurl);
                    bundle.putString("title", "在线客服");
                    intent.putExtras(bundle);
                    startActivity(intent);
                }
            }
        });
        insertidear.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(IdearActivity.this, EditActivity.class);
                intent.putExtra("type", "4");
                startActivity(intent);
            }
        });
        shensu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(IdearActivity.this, EditActivity.class);
                intent.putExtra("type", "5");
                startActivity(intent);
            }
        });
        headerButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //反馈记录
                Intent intent = new Intent(IdearActivity.this, IdearrdActivity.class);
                startActivity(intent);
            }
        });

    }

    @Override
    protected int setContentView() {
        return R.layout.activity_idear;
    }

    @Override
    protected void ChangeSkin() {
        switch (SkinId) {
            case 17771:
                skinbg.setBackgroundResource(R.mipmap.skin_bg1);
                break;
            case 17772:
                skinbg.setBackgroundResource(R.mipmap.skin_bg2);
                break;
            case 17773:
                skinbg.setBackgroundResource(R.mipmap.skin_bg3);
                break;
            default:
                skinbg.setBackgroundResource(R.mipmap.skin_bg1);
        }
    }
}
